home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / p4 / p4-1_2c.lha / p4-1.2c / lib / p4_sock_util.h < prev    next >
C/C++ Source or Header  |  1993-07-09  |  1KB  |  57 lines

  1. #ifdef CAN_DO_SOCKET_MSGS
  2. #include <sys/socket.h>
  3. #endif
  4. #include <netdb.h>
  5.  
  6. #ifdef P4BSD
  7. #include <sys/wait.h>
  8. #include <sys/resource.h>
  9. #endif
  10.  
  11. #ifdef CAN_DO_SETSOCKOPT
  12. #include <netinet/tcp.h>
  13. #endif
  14.  
  15. #define NET_RECV_GOOD 0
  16. #define NET_RECV_EOF  -1    
  17.  
  18. #define NET_EXEC 1
  19. #define NET_DONE 2
  20. #define NET_RESPONSE 3
  21.  
  22. #if defined(SP1)
  23. #define SOCK_BUFF_SIZE 16384
  24. #else
  25. #define SOCK_BUFF_SIZE 4096
  26. #endif
  27.  
  28. #define UNRESERVED_PORT 5001
  29.  
  30. struct net_message_t 
  31. {
  32.     int type:32;
  33.     int port:32;
  34.     int success:32;
  35.     char pgm[256];
  36.     char host[128];
  37.     char am_slave[32];
  38.     char message[512];
  39. };
  40.  
  41. /* Definitions for system messages between slaves */
  42. /* Macros to convert from integer to net byte order and vice versa */
  43. #ifdef P4BSD
  44. #define p4_i_to_n(n)  (int) htonl( (u_long) n)
  45. #define p4_n_to_i(n)  (int) ntohl( (u_long) n)
  46. #endif
  47.  
  48. #ifdef P4SYSV
  49. #if defined(IPSC860)  &&  !defined(IPSC860_SOCKETS)
  50. #define p4_i_to_n(n)  (n)
  51. #define p4_n_to_i(n)  (n)
  52. #else
  53. #define p4_i_to_n(n)  (int) htonl(n)
  54. #define p4_n_to_i(n)  (int) ntohl(n)
  55. #endif
  56. #endif
  57.